﻿using System;
using System.Collections.Generic;
using System.Text;
using Framework.Core.Domain;
using Framework.Message.SMS.SGIP;

namespace SGIPSPManager.Domain
{
    /// <summary>
    /// 下行信息
    /// </summary>
    public class MTMessage : EntityBase<Guid>
    {
        private long _SeqID;

        public long SeqID
        {
            get { return _SeqID; }
            set { _SeqID = value; }
        }

        private DateTime _SubmitDate;
        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime SubmitDate
        {
            get { return _SubmitDate; }
            set { _SubmitDate = value; }
        }

        private DateTime? _FinishDate = null;

        public DateTime? FinishDate
        {
            get { return _FinishDate; }
            set { _FinishDate = value; }
        }

        private string _ScrID;
        /// <summary>
        /// SP的接入号码
        /// </summary>
        public string ScrID
        {
            get { return _ScrID; }
            set { _ScrID = value; }
        }

        private string _ChargeNumber;
        /// <summary>
        /// 付费号码，手机号码前加“86”国别标志；当且仅当群发且对用户收费时为空；如果为空，则该条短消息产生的费用由UserNumber代表的用户支付；如果为全零字符串“000000000000000000000”，表示该条短消息产生的费用由SP支付。
        /// </summary>
        public string ChargeNumber
        {
            get { return _ChargeNumber; }
            set { _ChargeNumber = value; }
        }

        private string _UserNumber;
        /// <summary>
        /// 接收该短消息的手机号，该字段重复UserCount指定的次数，手机号码前加“86”国别标志
        /// </summary>
        public string UserNumber
        {
            get { return _UserNumber; }
            set { _UserNumber = value; }
        }

        private string _SPID;
        /// <summary>
        /// 企业代码，取值范围0-99999
        /// </summary>
        public string SPID
        {
            get { return _SPID; }
            set { _SPID = value; }
        }

        private string _ServiceType;
        /// <summary>
        /// 业务代码，由SP定义
        /// </summary>
        public string ServiceType
        {
            get { return _ServiceType; }
            set { _ServiceType = value; }
        }

        private FeeType _FeeType;
        /// <summary>
        /// 计费类型
        /// </summary>
        public FeeType FeeType
        {
            get { return _FeeType; }
            set { _FeeType = value; }
        }

        private string _FeeValue = "0";
        /// <summary>
        /// 取值范围0-99999，该条短消息的收费值，单位为分，由SP定义
        /// 对于包月制收费的用户，该值为月租费的值
        /// </summary>
        public string FeeValue
        {
            get { return _FeeValue; }
            set { _FeeValue = value; }
        }

        private string _GivenValue = "0";
        /// <summary>
        /// 取值范围0-99999，赠送用户的话费，单位为分，由SP定义，特指由SP向用户发送广告时的赠送话费
        /// </summary>
        public string GivenValue
        {
            get { return _GivenValue; }
            set { _GivenValue = value; }
        }

        private SubmitAgentFlag _AgentFlag;
        /// <summary>
        /// 代收费标志，0：应收；1：实收
        /// </summary>
        public SubmitAgentFlag AgentFlag
        {
            get { return _AgentFlag; }
            set { _AgentFlag = value; }
        }

        private SubmitMorelatetoMTFlag _MorelatetoMTFlag;
        /// <summary>
        /// 引起MT消息的原因
        /// </summary>
        public SubmitMorelatetoMTFlag MorelatetoMTFlag
        {
            get { return _MorelatetoMTFlag; }
            set { _MorelatetoMTFlag = value; }
        }

        private short _Priority = 0;
        /// <summary>
        /// 优先级0-9从低到高，默认为0
        /// </summary>
        public short Priority
        {
            get { return _Priority; }
            set { _Priority = value; }
        }

        private DateTime _ExpireTime = DateTime.Now;
        /// <summary>
        /// 短消息寿命的终止时间，如果为空，表示使用短消息中心的缺省值。时间内容为16个字符，格式为”yymmddhhmmsstnnp” ，其中“tnnp”取固定值“032+”，即默认系统为北京时间
        /// </summary>
        public DateTime ExpireTime
        {
            get { return _ExpireTime; }
            set { _ExpireTime = value; }
        }

        private DateTime _ScheduleTime = DateTime.Now;
        /// <summary>
        /// 短消息定时发送的时间，如果为空，表示立刻发送该短消息。时间内容为16个字符，格式为“yymmddhhmmsstnnp” ，其中“tnnp”取固定值“032+”，即默认系统为北京时间
        /// </summary>
        public DateTime ScheduleTime
        {
            get { return _ScheduleTime; }
            set { _ScheduleTime = value; }
        }

        private SubmitReportFlag _ReportFlag = SubmitReportFlag.ErrorReport;
        /// <summary>
        /// 状态报告标记
        /// </summary>
        public SubmitReportFlag ReportFlag
        {
            get { return _ReportFlag; }
            set { _ReportFlag = value; }
        }

        private int _TP_pid = 0;
        /// <summary>
        /// GSM协议类型。详细解释请参考GSM03.40中的9.2.3.9
        /// </summary>
        public int TP_pid
        {
            get { return _TP_pid; }
            set { _TP_pid = value; }
        }

        private int _TP_udhi = 0;
        /// <summary>
        /// GSM协议类型。详细解释请参考GSM03.40中的9.2.3.23,仅使用1位，右对齐
        /// </summary>
        public int TP_udhi
        {
            get { return _TP_udhi; }
            set { _TP_udhi = value; }
        }

        private MessageCoding _MessageCoding;
        /// <summary>
        /// 短消息的编码格式。
        /// </summary>
        public MessageCoding MessageCoding
        {
            get { return _MessageCoding; }
            set { _MessageCoding = value; }
        }

        private SubmitMessageType _MessageType;
        /// <summary>
        /// 信息类型
        /// </summary>
        public SubmitMessageType MessageType
        {
            get { return _MessageType; }
            set { _MessageType = value; }
        }

        private uint _MessageLength = 0;
        /// <summary>
        /// 短消息的长度
        /// </summary>
        public uint MessageLength
        {
            get { return _MessageLength; }
            set
            {
                if (_MessageLength != value)
                {
                    _MessageLength = value;
                }
            }
        }

        private string _MessageContent = "";
        /// <summary>
        /// 短消息的内容
        /// </summary>
        public string MessageContent
        {
            get { return _MessageContent; }
            set
            {
                if (_MessageContent != value)
                {
                    _MessageContent = value;
                }
            }
        }

        private MTStatus _Status;
        /// <summary>
        /// 
        /// </summary>
        public MTStatus Status
        {
            get { return _Status; }
            set { _Status = value; }
        }

        private int _ReSendTimes;
        /// <summary>
        /// 重发次数
        /// </summary>
        public int ReSendTimes
        {
            get { return _ReSendTimes; }
            set { _ReSendTimes = value; }
        }
    }
}
